package base.day21.MyHashSet2;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MyMap {
    public static void main(String[] args) {
        Map<Integer,String> m=new HashMap<>();
        m.put(1,"一号");
        m.put(2,"二号");
        m.put(3,"三号");
        m.put(4,"四号");

//        Set<Integer> keys = m.keySet();
//        for (Integer key : keys) {
//            String value = m.get(key);
//            System.out.println(key+value);
//        }


        Set<Map.Entry<Integer, String>> entries = m.entrySet();
        for (Map.Entry<Integer, String> entry : entries) {
            Integer key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+value);

        }
    }
}
